import java.lang.RuntimeException

class Car(val yearOfMake:Int, var theColor:String){
    var fuelLevel = 100
    var color  = theColor
    /*   set(value) {
            if (value.isBlank()|| theColor.isBlank()){
                throw RuntimeException("no empty")
            }
            field = value
        }*/
    private set(value) {
        if (value.isBlank()|| theColor.isBlank()){
            throw RuntimeException("no empty")
        }
        field = value
    }
}
var redCar = Car(2019,"Red")
println(redCar.color)
redCar.color = "Red"
println(redCar.color)
var rempCar = Car(2019,"Red")
redCar.color = ""

println(Car(2000,"white").color)